package com.buba.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.buba.domain.po.Student;
import com.buba.service.IStudentService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bilal
 * @since 2023-08-29
 */
@RestController
@RequestMapping("/student")
@RequiredArgsConstructor
public class StudentController {
    private final IStudentService studentService;
    /**
     * 查询60分以上的学生
     * @param pageNo
     * @param pageSize
     * @return
     */
    @GetMapping("/page")
    public Page<Student> queryStudent(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
                                       @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
        return studentService.queryStudent(pageNo, pageSize);
    }
}
